<?php

namespace Sensio\HelloBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\HelloBundle\Entity\Article;

class ArticleController extends Controller
{
    public function createAction()
    {
        $article = new Article();
        $article->setTitle('Jakiś artykuł '.time());
        $article->setText(md5(time()));
        $em = $this->get('doctrine.orm.entity_manager');
        $em->persist($article);
        $em->flush();
        return $this->render('HelloBundle:Hello:index.html.twig', array('name' => "Kuba"));
    }
}
